/*
 * File: OsTask.c
 *
 * Code generated for Interface Definition.
 *
 * Genrated author          :Insomnia
 * Tool version             :v1.0
 * Source code generated on :05-Aug-2020 15:51:55
 */
#include "RTE_CAN.h"
#include "includes.h"
#include "look1_iu16lu16n16_binlcase.h"


/* ~{6/A&5g3XW\5gAw~}  */
uint16_T Rte_CANTx_BatCurr_GetVal(void)
{
	if(bottv_ma_cur < 1000000 && bottv_ma_cur > 999700)
	{
		return 10000;
	}
	else if(bottv_ma_cur >= 1000000&&(vewm_flg_posRlyCtr==1 || bottv_flg_posRlyCtrl==1))
	{
		return (bottv_ma_cur+50)/100;//((1000000 + (BatPack.i32RawCurrent[1])*24/10))/500;
	}
	else if(bottv_ma_cur <= 999700&&(vewm_flg_posRlyCtr==1 || bottv_flg_posRlyCtrl==1))
	{
		return (bottv_ma_cur+50)/100;//((1000000 + (BatPack.i32RawCurrent[1])*24/10))/500;
	}
	else
	{
		return 10000;
	}


//	if(bottv_ma_cur < 1000500 && bottv_ma_cur > 999500)
//	{
//		return 1000;
//	}
//	else if(bottv_ma_cur >= 1000500&&(vewm_flg_posRlyCtr==1 || rlycv_flg_posRlyCtrl==1))
//	{
//		return (bottv_ma_cur+500)/1000;//((1000000 + (BatPack.i32RawCurrent[1])*24/10))/500;
//	}
//	else if(bottv_ma_cur <= 999500&&(vewm_flg_posRlyCtr==1 || rlycv_flg_posRlyCtrl==1))
//	{
//		return (bottv_ma_cur+500)/1000;//((1000000 + (BatPack.i32RawCurrent[1])*24/10))/500;
//	}
//	else
//	{
//		return 1000;
//	}




}

uint16_T Rte_CANTx_BatCurr2_GetVal(void)
{
	if(bottv_ma_cur < 1000500 && bottv_ma_cur > 999500)
	{
		return 500*50;
	}
	else if(bottv_ma_cur >= 1000500)
	{
		return (bottv_ma_cur - 500000 + 10)/20;
	}
	else if(bottv_ma_cur <= 999500)
	{
		return (1500000 - bottv_ma_cur + 10)/20;
	}
	else
	{
		return 500*50;
	}

}

uint16_T Rte_CANTx_BatCurr3_GetVal(void)
{

	if(bottv_ma_cur < 1000500 && bottv_ma_cur > 999500)
	{
		return 10000;
	}
	else if(bottv_ma_cur >= 1000500&&(vewm_flg_posRlyCtr==1 || bottv_flg_posRlyCtrl==1))
	{
		return (bottv_ma_cur+50)/100;//((1000000 + (BatPack.i32RawCurrent[1])*24/10))/500;
	}
	else if(bottv_ma_cur <= 999500&&(vewm_flg_posRlyCtr==1 || bottv_flg_posRlyCtrl==1))
	{
		return (bottv_ma_cur+50)/100;//((1000000 + (BatPack.i32RawCurrent[1])*24/10))/500;
	}
	else
	{
		return 10000;
	}

}

uint16_T Rte_CANTx_BatPower_GetVal(void)
{
	real32_T curr;
	real32_T pwr;

	if(bottv_ma_cur < 1000500 && bottv_ma_cur > 999500)
	{
		curr = 0;
	}

	curr = ((real32_T)bottv_ma_cur - 1000000)/1000.0;

	pwr = curr*bottv_v_packVlt/1000/10;

	return (uint16_T)((uint16_T)pwr + 32500);

}


/* ~{6/A&5g3XW\5gQ9~} */
uint16_T Rte_CANTx_PackVolt_GetVal(void)
{

	return (Rte_mv_PackVolt_GetVal()+50)/100;//((uint32_T)(BatPack.u16VoltCell[1][18])*52/1000);
}

uint16_T Rte_CANTx_linkVolt_GetVal(void)
{
	return (Rte_mv_VLink_GetVal()+50)/100;//((uint32_T)(BatPack.u16VoltCell[1][18])*52/1000);
}

uint16_T Rte_CANTx_ptcVolt_GetVal(void)
{
	return (Rte_mv_PtcVol_GetVal()+50)/100;//((uint32_T)(BatPack.u16VoltCell[1][18])*52/1000);
}

//uint16_T Rte_CANTx_TablSOC_GetVal(void)
//{
//	return soce_pct_TablSOC;
//}
/* (SOC) */
uint16_T Rte_CANTx_DispSOC_GetVal(void)
{
	if(bottv_flg_SOCReady)
	{
//		if(soce_pct_DispSOC > 9940 && vewm_enum_SlowChgSts!=2)
//		{
//			return 10000;
//		}
//		else if(soce_pct_DispSOC <= 9940 && soce_pct_DispSOC >= 9900 &&vewm_enum_SlowChgSts!=2)
//		{
//			return 9900;             (9940+50)/100*100
//		}
//		else
//		{
			return (soce_pct_DispSOC+50)/100*100;
//		}
	}
	else
	{
		return look1_iu16lu16n16_binlcase(bottv_pct_initSoc,
		        rtCP_OCVTableHi2_bp01Data, rtCP_OCVTableHi2_tableData, 12U);
	}


}

/* ~{6/A&5g3XN,;$GkGs~} */
uint8_T Rte_CANTx_PowerBatMaintainReq_GetVal(void)
{
	if(fltm_enum_insuU ||
		fltm_enum_hvilFlt == 3 ||
		fltm_enum_CurrSmpAbnl == 3 ||
		fltm_enum_CellTmpSmpFlt == 3 ||
		fltm_enum_CellVolSmpFlt == 3 ||
		fltm_enum_PTCHeatInvalid == 3||
		fltm_enum_ptcAdFlt == 3 ||
		fltm_enum_posRlyAd == 3 ||
		fltm_enum_sohU == 3||
		fltm_enum_ThermRunaway == 3)
	{
		return 1;
	}
	else
	{
		return 0;
	}

}

/* ~{6/A&5g3XGP6OV8J>~} */
uint8_T Rte_CANTx_BatDisconnectDisp_GetVal(void)
{
	return (Rte_mv_VLink_GetVal()*100 < Rte_mv_PackVolt_GetVal()*95)? 1:0;
}

/* ~{3d5gA,=SOTJ>~} */
uint8_T Rte_CANTx_ChgWireConntsDisp_GetVal(void)
{
	return (Rte_flg_SChgIgSts_GetVal() == 1)? 1:0;
}

/* Pack~{51G0>y:bW4L,~} */
uint8_T Rte_CANTx_BalRunSts_GetVal(void)
{
	return 0;
}

/* BMS~{TJPmOB5MQ95g=xHkP]C_~} */
uint8_T Rte_CANTx_LowPowerOffPrmt_GetVal(void)
{
	return (uint8_T)((vewm_enum_workingMode > Pdcfg_WmAfterRun)? 1:0);
}

/* BMS~{WT<lW4L,~} */
uint8_T Rte_CANTx_BMSSelfChk_GetVal(void)
{
	if(fltm_enum_SelfChkSts == 1)
	{
		return 2;
	}
	if(fltm_enum_SelfChkSts == 2)
	{
		return 3;
	}
	else
	{
		return 1;
	}
}

/* BMS~{GkGs8_Q9OB5g~} */
uint8_T Rte_CANTx_BMSReqPowerOff_GetVal(void)
{
	if((fltm_flg_DsgPwrDownFlt > 0) || (fltm_flg_ChgPwrDownFlt > 0))
	{
		return 1;
	}
	else
	{
		return 0;
	}
}

/* ~{5g3X9}HH1(>/<0HHJ':bV8J>5F~} */
uint8_T Rte_CANTx_CellTempOTSts_GetVal(void)
{
	return (fltm_enum_ThermRunaway == 3) ? 2 : ((fltm_enum_cellOTFlt == 3)? 1:0);
}

/* Pack~{U}<+>xT5V5~} */
uint16_T Rte_CANTx_InsPRes_GetVal(void)
{
	uint32_T Tmp;
	uint16_T rad=0;
	static uint8_T cnt = 0;
	cnt ++;
	if(cnt > 99) cnt = 0;
	Tmp = bottv_ms_sysRunTime + soce_pct_SOC;

	if((Tmp/100%cnt) == 13 )
	{
		rad = (uint16_T)(Tmp%20);
	}


	if(bottv_ohm_isoRpRes < 10000)
	{
		return bottv_ohm_isoRpRes;
	}
	else
	{
		return 60000-rad;
	}
//	if(bottv_ohm_isoRpRes >= 5000)
//	{
//		return 5000-rad;
//	}
//	else
//	{
//		return bottv_ohm_isoRpRes;
//	}


}

/* Pack~{8:<+>xT5V5~} */
uint16_T Rte_CANTx_InsNRes_GetVal(void)
{
	uint32_T Tmp;
	uint16_T rad=0;
	static uint8_T cnt = 0;
	cnt ++;
	if(cnt > 99) cnt = 0;
	Tmp = bottv_ms_sysRunTime + soce_pct_SOC;


	if((Tmp/300%cnt) == 11 )
	{
		rad = (uint16_T)(Tmp%20);
	}

	if(bottv_ohm_isoRnRes < 10000)
	{
		return bottv_ohm_isoRnRes;
	}
	else
	{
		return 60000-rad;
	}

}

/* ~{>xT5V5~} */
uint16_T Rte_CANTx_InsRes_GetVal(void)
{
	uint16_T temp ;
	temp = (uint16_T)((Rte_CANTx_InsPRes_GetVal() < Rte_CANTx_InsNRes_GetVal()) ? Rte_CANTx_InsPRes_GetVal():Rte_CANTx_InsNRes_GetVal());

	return temp;//0.1M
}

/* ~{Wn5M5gQ95%LePr:E~} */
uint16_T Rte_CANTx_CellVoltMinNum_GetVal(void)
{
	return bottv_no_cVltMin;
}

/* ~{Wn8_5gQ95%LePr:E~} */
uint8_T Rte_CANTx_CellVoltMaxNum_GetVal(void)
{
	return bottv_no_cVltMax;
}

/* ~{Wn5MNB6HL=Uk:E~} */
uint8_T Rte_CANTx_CellTempMinNum_GetVal(void)
{
	return bottv_no_cTmpMin;
}

/* ~{Wn8_NB6HL=Uk:E~} */
uint16_T Rte_CANTx_CellTempMaxNum_GetVal(void)
{
	return bottv_no_cTmpMax;
}


//{
//
//	if((soce_pct_SOC > 9900 && vewm_enum_FastChgSts==2 && vewm_flg_rechg == 0)||tmsc_enum_HeatSts ==5)
//	{
//		return Rte_CANTx_PackVolt_GetVal();
//	}
//
//	else if((tmsc_enum_HeatSts == 2||(tmsc_enum_HeatSts == 5 && tmsc_flg_PTCRlyCtr==1))&&vewm_flg_posRlyCtr==0)
//		{
//
//
//			if((fltm_enum_packOVFlt >= 2) || (fltm_enum_cellDiffTmpFlt==3))//(tmsc_enum_HeatSts == 5 && tmsc_flg_PTCRlyCtr==0) ||
//			{
//			   return 0;
//			}
//			else
//			{
//			    return 1120;
//			}
//
//		}
//		else
//		{
//		    if(tmsc_enum_HeatSts == 4)
//		    {
//			    return  Rte_CANTx_PackVolt_GetVal()-10;
//		    }
//		    else if(tmsc_flg_PTCRlyCtr == 0 && vewm_flg_posRlyCtr ==0)
//		    {
//			    return 0;
//		    }
//		    else if(vewm_enum_workingMode == Pdcfg_WmQChging)
//		    {
//		    	return sopv_mv_ChgReqVol;
//		    }
//		    else
//		  	{
//		  	    return 0;
//		  	}
//
//		}
//}
uint16_T Rte_CANTx_DCChgVoltReq_GetVal(void)
{

	if(vewm_enum_workingMode == Pdcfg_WmQChging)
	{
		return 1388;
	}
	else
	{
		return 0;
	}
}
//	if(tmsc_enum_HeatSts == 2 && vewm_enum_FastChgSts==2 && flg == 0)
//	{
//		ReqVolt = Rte_CANTx_PackVolt_GetVal();
//		flg = 1;
//	}
//	if(tmsc_enum_HeatSts == 2 && vewm_enum_FastChgSts==2)
//	{
//		return 1310;
//		ReqVoltLim = Rte_CANTx_PackVolt_GetVal();
//		cnt ++;
//		if((soce_pct_SOC > 5000 || bottv_mv_cVltMin > 3300)&&cnt>=6
//				&&((ReqVolt - ReqVoltLim<=10)||(ReqVoltLim - ReqVolt <= 10))&&Rte_CANRx_FDCMaiPosRlySts_GetVal() == 1)
//		{
//			if(Rte_CANTx_BatCurr_GetVal()<10001)
//			{
//				ReqVolt++;
//				cnt = 0;
//			}
//			else if(Rte_CANTx_BatCurr_GetVal()>10003)
//			{
//				ReqVolt--;
//				cnt = 0;
//			}
//			return ReqVolt;
//
//		}
//		if((soce_pct_SOC<5000 || bottv_mv_cVltMin<3100)&&cnt>=6
//				&&((ReqVolt - ReqVoltLim<=10)||(ReqVoltLim - ReqVolt <= 10))&&Rte_CANRx_FDCMaiPosRlySts_GetVal() == 1)
//		{
//			if(Rte_CANTx_BatCurr_GetVal()<9996)
//			{
//				ReqVolt++;
//				cnt = 0;
//			}
//			else if(Rte_CANTx_BatCurr_GetVal()>9998)
//			{
//				ReqVolt--;
//				cnt = 0;
//			}
//			return ReqVolt;
//		}
//		return ReqVolt;



uint16_T Rte_CANTx_DCChgCurrReq_GetVal(void)
{
	static uint8_T flg = 0;
	static uint16_T ReqCurr = 0;
	static uint8_T cnt = 0;
//	static uint8_T count = 0;

	if(tmsc_enum_HeatSts == 2 && vewm_enum_FastChgSts==2 && flg == 0)
	{
		ReqCurr = 500;
		flg = 1;
	}
	if(tmsc_enum_HeatSts == 2 && vewm_enum_FastChgSts==2)
	{
		cnt = 0;
//		count ++;
//		if(count > 40)
//		{
//			count = 40;
//		}
		if(bottv_mv_cVltMin > 3250 && Rte_CANRx_FDCMaiPosRlySts_GetVal() == 1 && cnt == 0)
		{
			cnt = 1;
			if(bottv_ma_cur > 1000300)
			{

				ReqCurr = ReqCurr + ((Rte_CANTx_BatCurr_GetVal()-10000));
			}
			else if(Rte_CANTx_BatCurr_GetVal() < 1000000)
			{
				ReqCurr = ReqCurr + ((Rte_CANTx_BatCurr_GetVal()-10000));
			}
		}
		else if(bottv_mv_cVltMin < 3250 && Rte_CANRx_FDCMaiPosRlySts_GetVal() == 1 && cnt == 0)
		{
			cnt = 1;
			if(bottv_ma_cur > 1000000)
			{

				ReqCurr = ReqCurr + ((Rte_CANTx_BatCurr_GetVal()-10000));
			}
			else if(Rte_CANTx_BatCurr_GetVal() < 999700)
			{
				ReqCurr = ReqCurr + ((Rte_CANTx_BatCurr_GetVal()-10000));
			}
		}
		return ReqCurr;

	}
	else if(vewm_enum_workingMode == Pdcfg_WmQChging && tmsc_enum_HeatSts != 2)
	{
		flg = 0;
//		count = 0;
		return sopv_ma_ChgReqCur*10;
	}
	else
	{
		return 0;
	}

}
//{
//	if((tmsc_enum_HeatSts == 2||(tmsc_enum_HeatSts == 5 && tmsc_flg_PTCRlyCtr==1))&&vewm_flg_posRlyCtr==0)
//		{
//
//
//			if((tmsc_enum_HeatSts == 5 && tmsc_flg_PTCRlyCtr==0) || (fltm_enum_packOVFlt >= 2) || (fltm_enum_cellDiffTmpFlt==3))
//			{
//			    return 0;
//			}
//			else
//			{
//			    return 350;
//			}
//
//		}
//
//		else
//		{
//
//		    if(tmsc_enum_HeatSts == 7)
//		    {
//		    		return 50;
//		    }
//		    if(tmsc_enum_HeatSts == 4)
//		    {
//			    	return 200;
//		    }
//		    else if(tmsc_flg_PTCRlyCtr == 0 && vewm_flg_posRlyCtr ==0)
//		    {
//			    	return 0;
//		    }
//		    else if((tmsc_enum_HeatSts == 5 && tmsc_flg_PTCRlyCtr==0) || (fltm_enum_packOVFlt >= 2) || (fltm_enum_cellDiffTmpFlt==3))
//	        {
//	            	return 0;
//	        }
//	        else if(vewm_enum_workingMode == Pdcfg_WmQChging)
//	        {
//	                return sopv_ma_ChgReqCur;
//	        }
//	        else
//	        {
//	        		return 0;
//	        }
//
//
//		}
//}

uint8_T Rte_CANTx_DCChgVoltSts_GetVal(void)
{
	uint8_T sts;

	if((fltm_enum_cellOVFlt>=2 || fltm_enum_packOVFlt>=2 || fltm_flg_ChgPwrDownFlt==1)&&vewm_enum_workingMode == Pdcfg_WmQChging)

	{
		return 3;
	}
	if((Rte_CANTx_DispSOC_GetVal() == 10000 && Rte_CANRx_CC1Sts != 1 && Rte_CANRx_FDCMaiPosRlySts == 0)||
			(Rte_CANTx_DispSOC_GetVal() != 10000 && Rte_CANRx_CC1Sts == 1 && Rte_CANRx_FDCMaiPosRlySts == 0))
	{
		return 0;
	}
	if(Rte_CANTx_DispSOC_GetVal() != 10000 && Rte_CANRx_CC1Sts == 1 && Rte_CANRx_FDCMaiPosRlySts == 1)
	{
		return 1;
	}
	if(Rte_CANTx_DispSOC_GetVal() == 10000 && Rte_CANRx_CC1Sts == 1)
	{
		return 2;
	}
	else
	{
		return 0;
	}
}

/* ~{=;Aw3dGkGs5gQ9~} */
//	if(tmsc_enum_HeatSts == 2)
//		{
//			return 1120;
//		}
//	if(tmsc_enum_HeatSts == 4)
//		{
//			return Rte_CANTx_PackVolt_GetVal()-10;
//		}
//	else
//	{
//		return sopv_mv_ChgReqVol;
//	}



/* ~{=;Aw3dGkGs5gAw~} */
uint16_T Rte_CANTx_ACChgCurrReq_GetVal(void)
{
	if((tmsc_enum_HeatSts == 2||(tmsc_enum_HeatSts == 5 && tmsc_flg_PTCRlyCtr==1))&&vewm_flg_posRlyCtr==0)
		{


			if((tmsc_enum_HeatSts == 5 && tmsc_flg_PTCRlyCtr==0) || (fltm_enum_packOVFlt >= 2) || (fltm_enum_cellDiffTmpFlt==3))
			{
			    return 0;
			}
			else
			{
			    return 200;
			}

		}
		else
		{

		    if(tmsc_enum_HeatSts == 7)
		    {
		    		return 50;
		    }
		    if(tmsc_enum_HeatSts == 4)
		    {
			    return 200;
		    }
		    else if(tmsc_flg_PTCRlyCtr == 0 && vewm_flg_posRlyCtr ==0)
		    {
			    return 0;
		    }
		    else if((tmsc_enum_HeatSts == 5 && tmsc_flg_PTCRlyCtr==0) || (fltm_enum_packOVFlt >= 2) || (fltm_enum_cellDiffTmpFlt==3))
	        {
	                return 0;
	        }
	        else if(vewm_enum_workingMode == Pdcfg_WmSChging)
	        {
	                return sopv_ma_ChgReqCur;
	        }
	        else
	        {
	        		return 0;
	        }


		}
}
//if(tmsc_enum_HeatSts == 2 || tmsc_enum_HeatSts == 4)
//	{
//		return 200;
//	}
//	if((tmsc_enum_HeatSts == 5 && tmsc_flg_PTCRlyCtr==0) || (fltm_enum_packOVFlt >= 2) || (fltm_enum_cellDiffTmpFlt==3))
//	{
//		return 0;
//	}
//	else if(fltm_enum_CellVolSmpFlt > 0 || fltm_enum_CellTmpSmpFlt > 0 || fltm_enum_CurrSmpAbnl > 0 || fltm_enum_PackVolSmpFlt > 0)
//	{
//		return sopv_ma_ChgReqCur = sopv_ma_ChgReqCur*25/100;
//	}
//	else
//	{
//		return sopv_ma_ChgReqCur;
//	}


/* ~{=;Aw3d5g;zFt6/3d5gGkGs~}*/
uint8_T Rte_CANTx_ACChgEnReq_GetVal(void)
{
        static uint32_T chgFshTime = 0;

        if(Rte_enum_SChgCcSts_GetVal()==0 && Rte_flg_SChgIgSts_GetVal()==0)
        {
                chgFshTime = 0;
        }

        //86400
        if((vewm_enum_SlowChgSts==4 && tmsc_flg_keepTempTime==0 && chgFshTime<=57600)//Rte_c_CellMinTmp_GetVal()<=55 &&
        		||vewm_enum_SlowChgSts == 10 || vewm_enum_SlowChgSts == 2 || tmsc_enum_HeatSts == 1
				|| tmsc_enum_HeatSts == 2 || tmsc_enum_HeatSts == 3||tmsc_enum_HeatSts== 4
				||(tmsc_flg_PTCRlyCtr == 1 && vewm_enum_workingMode == Pdcfg_WmSChging))
        {
                if((vewm_enum_SlowChgSts==4 || vewm_enum_keeptempdly==1) && Rte_c_CellMinTmp_GetVal()<=55)
                {
                        chgFshTime ++;
                }

                if(fltm_enum_cellOVFlt>=2 || fltm_enum_packOVFlt>=2 || fltm_flg_ChgPwrDownFlt==1)
                {
                        return 2;
                }
                else if(tmsc_flg_keepTempTime==1)
                {
                	 	 return 1;
                }
                else
                {
                        return 0;
                }
        }
        else if(fltm_flg_ChgPwrDownFlt==1)
        {
        	  	return 2;
        }
        else
        {
             	return 1;
        }
}
//uint8_T Rte_CANTx_ACChgEnReq_GetVal(void)
//{
//        static uint32_T chgFshTime = 0;
//
//        if(Rte_enum_SChgCcSts_GetVal()==0 && Rte_flg_SChgIgSts_GetVal()==0)
//        {
//                chgFshTime = 0;
//                return 0;
//        }
//
//        if(vewm_enum_SlowChgSts==4 && Rte_c_CellMinTmp_GetVal()<=55)
//        {
//                chgFshTime ++;
//        }
//        if((vewm_enum_SlowChgSts==4 && tmsc_flg_keepTempTime==1)||
//        		(vewm_enum_workingMode == 1 && soce_pct_SOC>=9950 && (chgFshTime>86400 || chgFshTime <1)))
//        {
//        	    return 1;
//        }
//        if(fltm_enum_cellOVFlt>=2 || fltm_enum_packOVFlt>=2 || fltm_flg_ChgPwrDownFlt==1)
//        {
//                return 2;
//        }
//        else
//        {
//                return 0;
//        }
//}



///* ~{=;Aw3d5g;zFt6/3d5gGkGs~}*/
//uint8_T Rte_CANTx_ACChgEnReq_GetVal(void)
//{
//	if((vewm_enum_SlowChgSts==4 && Rte_c_CellMinTmp_GetVal()<=55 && tmsc_flg_keepTempTime==0)||\
//			vewm_enum_SlowChgSts == 10 || vewm_enum_SlowChgSts == 2 || tmsc_enum_HeatSts == 1 ||\
//			tmsc_enum_HeatSts == 2 || tmsc_enum_HeatSts == 3||tmsc_enum_HeatSts== 4||\
//			tmsc_flg_PTCRlyCtr == 1)
//	{
//		if(fltm_enum_cellOVFlt<2 && fltm_enum_packOVFlt<2 )
//		{
//			return 1;
//		}
//		else
//		{
//			return 0;
//		}
//	}
//	else
//	{
//		return 0;
//	}
//}

/* ~{=;Aw3d5gW4L,~} */
uint16_T Rte_CANTx_ACChgVoltReq_GetVal(void)
{
	static uint32_T chgFshTime = 0;

	 if(Rte_enum_SChgCcSts_GetVal()==0 && Rte_flg_SChgIgSts_GetVal()==0)
	        {
	                chgFshTime = 0;
	        }

	 if(vewm_enum_SlowChgSts==4 && Rte_c_CellMinTmp_GetVal()<=55)
	        {
	                chgFshTime ++;
	        }


	if( (chgFshTime<=57600 && chgFshTime>0 && ((soce_pct_SOC > 9900 && vewm_enum_SlowChgSts==4)||
			(soce_pct_SOC > 9900 && vewm_enum_SlowChgSts==2 && vewm_flg_rechg == 0)))||tmsc_enum_HeatSts ==5)
	{
		return Rte_CANTx_PackVolt_GetVal();
	}

	else if((tmsc_enum_HeatSts == 2||(tmsc_enum_HeatSts == 5 && tmsc_flg_PTCRlyCtr==1))&&vewm_flg_posRlyCtr==0)
		{


			if((fltm_enum_packOVFlt >= 2) || (fltm_enum_cellDiffTmpFlt==3))//(tmsc_enum_HeatSts == 5 && tmsc_flg_PTCRlyCtr==0) ||
			{
			   return 0;
			}
			else
			{
			    return 1184;
			}

		}
		else
		{
		    if(tmsc_enum_HeatSts == 4)
		    {
			    return  Rte_CANTx_PackVolt_GetVal()-10;
		    }
		    else if(tmsc_flg_PTCRlyCtr == 0 && vewm_flg_posRlyCtr ==0)
		    {
			    return 0;
		    }
		    else if(vewm_enum_workingMode == Pdcfg_WmSChging)
		    {
		    	return sopv_mv_ChgReqVol;
		    }
		    else
		  	{
		  	    return 0;
		  	}

		}
}



uint8_T Rte_CANTx_ACChgVoltSts_GetVal(void)
{
	uint8_T sts;

	if(fltm_enum_cellOVFlt>=2 || fltm_enum_packOVFlt>=2 || fltm_flg_ChgPwrDownFlt==1)

	{
		return 3;
	}
	if((Rte_CANTx_DispSOC_GetVal() == 10000 && Rte_CANRx_CCSts != 2 && Rte_flg_SChgIgSts_GetVal() == 0)||
			(Rte_CANTx_DispSOC_GetVal() != 10000 && Rte_CANRx_CCSts == 2 && Rte_flg_SChgIgSts_GetVal() == 0))
	{
		return 0;
	}
	if(Rte_CANTx_DispSOC_GetVal() != 10000 && Rte_CANRx_CCSts == 2 && Rte_flg_SChgIgSts_GetVal() == 1)
	{
		return 1;
	}
	if(Rte_CANTx_DispSOC_GetVal() == 10000 && Rte_CANRx_CCSts == 2)
	{
		return 2;
	}
	else
	{
		return 0;
	}
}

//uint8_T Rte_CANTx_OBC1COMSts_GetVal(void)
//{
//	static uint8_T oldcnt = 0;
//	static uint8_T cnt = 0;
//
//	if(Rte_CANRx_OBC_LifeCnt != oldcnt)
//	{
//		oldcnt = Rte_CANRx_OBC_LifeCnt;
//		return 1;
//	}
//	else
//	{
//
//		cnt ++;
//
//		if(cnt>5)
//		{
//			cnt = 0;
//			return 0;
//		}
//
//	}
//	if(Rte_CANRx_OBC_LifeCnt == 0)
//	{
//		return 0;
//	}
//	else
//	{
//		return 1;
//	}
//
//}
//{
//	static uint8_T sts;
//	static uint8_T flg = 1;
//	static uint16_T curr_cnt = 0;
//
//	if(bottv_ma_cur > 1005000)
//	{
//		curr_cnt ++;
//	}
//	else
//	{
//		curr_cnt = 0;
//	}
//
//	if(curr_cnt > 100)
//		flg = 1;
//
//
//	if(vewm_enum_SlowChgSts == 2 || vewm_enum_SlowChgSts == 3)
//	{
//		sts = 1;
//		flg = 0;
//	}
//	else if(vewm_enum_SlowChgSts == 4 && flg == 0)
//	{
//		sts = 2;
//	}
//	else
//	{
//		sts = 0;
//	}
//
//	return sts;
//
//}

/* BMS~{9JUOW\J}~}  */
uint8_T Rte_CANTx_FltNum_GetVal(void)
{
	return fltm_enum_FltNum;
}

/* ~{5%Le5g3XWn8_5gQ9~} */
uint16_T Rte_CANTx_CellVoltMax_GetVal(void)
{
	return bottv_mv_cVltMax;
}

/* ~{5%Le5g3XWn5M5gQ9~} */
uint16_T Rte_CANTx_CellVoltMin_GetVal(void)
{
	return bottv_mv_cVltMin;
}

/* ~{5g3XWn8_NB6H~} */
uint8_T Rte_CANTx_CellTempMax_GetVal(void)
{
	return bottv_c_cTmpMax;
}

/* ~{5g3XWn5MNB6H~} */
uint8_T Rte_CANTx_CellTempMin_GetVal(void)
{
	return bottv_c_cTmpMin;
}

uint8_T Rte_CANTx_BATT_TEMP_LAMP_GetVal(void)
{
	if(bottv_c_cTmpMin < 20)
	{
		return 1;
	}
	else if(bottv_c_cTmpMax >= 85 && bottv_c_cTmpMax < 95)
	{
		return 4;
	}
	else if(bottv_c_cTmpMax >= 95)
	{
		return 5;
	}
	else if(bottv_c_cTmpMin >= 20 && bottv_c_cTmpMin < 50)
	{
		return 2;
	}
	else if(bottv_c_cTmpMin >= 50 && bottv_c_cTmpMin < 85)
	{
		return 3;
	}
	else
	{
		return 0;
	}
}

/* ~{5g3XF=>yNB6H~} */
uint8_T Rte_CANTx_CellTempAvg_GetVal(void)
{
	return bottv_c_cTmpAvg;
}

/* ~{5g3X=!?5V8J}~}  */
uint8_T Rte_CANTx_SOH_GetVal(void)
{
        return (uint8_T)((sohe_pct_soh+9)/10);//SOH~{OrIOH!U{~}
}

/* ~{6LJ17E5g9&D\W4L,~} */
uint16_T Rte_CANTx_PeakDsgCurr_GetVal(void)
{
//	if((vewm_enum_DisSts==2 || vewm_enum_DisSts==3) && Rte_enum_SChgCcSts_GetVal()==0)
//	{
		if(fltm_enum_cellOTFlt < 3 && fltm_enum_cellUTFlt < 3)
		{
			return sopv_ma_DsgMax;
		}
		else
		{
			return 0;
		}
//	}
//	else
//	{
//		return 0;
//	}
}


/* ~{3VPx7E5g9&D\W4L,~} */
uint16_T Rte_CANTx_ContDsgCurr_GetVal(void)
{
//	if((vewm_enum_DisSts==2 || vewm_enum_DisSts==3) && Rte_enum_SChgCcSts_GetVal()==0)
//	{
		if(fltm_enum_cellOTFlt < 3 && fltm_enum_cellUTFlt < 3)
		{
			return sopv_ma_DsgCont;
		}
		else
		{
			return 0;
		}
//	}
//	else
//	{
//		return 0;
//	}
}


/* ~{6LJ13d5g9&D\W4L,~}  */
uint16_T Rte_CANTx_PeakChgCurr_GetVal(void)
{
//	if((vewm_enum_DisSts==2 || vewm_enum_DisSts==3)  && Rte_enum_SChgCcSts_GetVal()==0)
//	{
		if(fltm_enum_cellOTFlt < 3 && fltm_enum_cellUTFlt < 3)
		{
			return sopv_ma_BackPulse;
		}
		else
		{
			return 0;
		}
//	}
////	else
//	{
//		return 0;
//	}
}


/* ~{3VPx3d5g9&D\W4L,~} */
uint16_T Rte_CANTx_ContChgCurr_GetVal(void)
{

//	if((vewm_enum_DisSts==2 || vewm_enum_DisSts==3) && Rte_enum_SChgCcSts_GetVal()==0)
//	{
		if(fltm_enum_cellOTFlt < 3 && fltm_enum_cellUTFlt < 3)
		{
			return sopv_ma_BackCont;
		}
		else
		{
			return 0;
		}
//	}
//	else
//	{
//		return 0;
//	}
}


/* ~{6LJ17E5g9&D\W4L,~} */
uint16_T Rte_CANTx_PeakDsgPwr_GetVal(void)
{
	return ((sopv_ma_DsgPulse/10)*((bottv_v_packVlt+500)/1000) + 50)/100;//(vewm_enum_DisSts==2) ?
}
/* ~{6LJ13d5g9&D\W4L,~}  */
uint16_T Rte_CANTx_PeakChgPwr_GetVal(void)
{
	return ((sopv_ma_BackPulse/10)*((bottv_v_packVlt+500)/1000) + 50)/100;//(vewm_enum_DisSts==2) ?
}

/* ~{3VPx7E5g9&D\W4L,~} */
uint16_T Rte_CANTx_ContDsgPwr_GetVal(void)
{
	return ((sopv_ma_DsgCont/10)*((bottv_v_packVlt+500)/1000) + 50)/100;//(vewm_enum_DisSts==2) ?
}
/* ~{3VPx3d5g9&D\W4L,~}  */
uint16_T Rte_CANTx_ContChgPwr_GetVal(void)
{
	return ((sopv_ma_BackCont/10)*((bottv_v_packVlt+500)/1000) + 50)/100;//(vewm_enum_DisSts==2) ?
}


/* ~{VwU}<L5gFwW4L,~}  */
uint8_T Rte_CANTx_MaiPosRlySts_GetVal(void)
{
	return vewm_flg_posRlyCtr||bottv_flg_posRlyCtrl;
}

/* ~{<SHH<L5gFwW4L,~}  */
uint8_T Rte_CANTx_PTCRlySts_GetVal(void)
{
	return tmsc_flg_PTCRlyCtr||bottv_flg_heatRlyCtrl;
}

/* ~{5g3XT$3dW4L,~}  */
uint8_T Rte_CANTx_PrechgSts_GetVal(void)
{
	return vewm_enum_PrechrgSts;
}

/* ~{T$3d<L5gFwW4L,~}  */
uint8_T Rte_CANTx_PrechgRlySts_GetVal(void)
{
	return vewm_flg_prechgRlyCtr||bottv_flg_PrechgRlyCtrl;
}

/* ~{V1Aw3d5g<L5gFwW4L,~}  */
uint8_T Rte_CANTx_DCChgRlySts_GetVal(void)
{
	return 0;
}

/* Pack~{6n6(H]A?~}  */
uint16_T Rte_CANTx_BatRateCap_GetVal(void)
{
	return Pccfg_BatRatedCap;
}

/* Pack~{6n6(5gQ9~}  */
uint16_T Rte_CANTx_BatRateVolt_GetVal(void)
{
	return (uint16_T)Pccfg_BatRatedHighVolt;
}

/* Pack~{6n6(W\D\A?~}  */
uint16_T Rte_CANTx_PackRateEnergy_GetVal(void)
{
	return (uint16_T)Pccfg_BatRatedEnergy;
}

/* ~{5g3X@`PM~}  */
uint8_T Rte_CANTx_BatType_GetVal(void)
{
	return 3;
}

/* ~{5g3X3'<R~}  */
uint8_T Rte_CANTx_BatManufacture_GetVal(void)
{
	return Pccfg_BatManufacture;
}

/* ~{5g3XO5M351G0Wn8_9JUO5H<6~}  */
uint8_T Rte_CANTx_FltLvMax_GetVal(void)
{
	if(fltm_num_maxFltNo == 1)
	{
		return 1;
	}
	else if(fltm_num_maxFltNo == 2)
	{
		return 2;
	}
	else if(fltm_num_maxFltNo == 3)
	{
		return 3;
	}
	else
	{
		return 0;
	}

//	return fltm_num_maxFltNo;
}

/* ~{>xT5WhV59}5M1(>/~}  */
uint8_T Rte_CANTx_InsResFltLv_GetVal(void)
{
	return fltm_enum_insuU;
}

/* ~{5g3XO5M39JUO4zBk~}  */
uint8_T Rte_CANTx_FltCode_GetVal(void)
{
	static uint8_T fltcnt = 0;
	static uint8_T delaycnt = 0;
	uint8_T i;

	delaycnt ++;
	if(delaycnt>5)
	{
		delaycnt = 0;

		for(i=0;i<10;i++)
		{
			if(fltcnt >= 10)
				fltcnt = 0;

			if(fltm_enum_FaultCode[fltcnt++] > 0)
			{
				return fltm_enum_FaultCode[fltcnt-1];
			}
		}
	}
//3?
	return (fltcnt>0&&fltm_enum_FaultCode[fltcnt-1]>0)? fltm_enum_FaultCode[fltcnt-1] : fltm_enum_FaultCode[0];//fltm_enum_FaultCode[fltcnt-1];
}

/* ~{VwU}=S4%Fw9JUO~}  */
uint8_T Rte_CANTx_PosRlyFlt_GetVal(void)
{
	if(fltm_enum_posRlyOp > 0)
	{
		return 1;
	}
	else if(fltm_enum_posRlyAd > 0)
	{
		return  2;
	}
	else
	{
		return  0;
	}

}

/* ~{<SHH=S4%Fw9JUO~}  */
uint8_T Rte_CANTx_PTCRlyFlt_GetVal(void)
{
	if(fltm_enum_PTCRlyOp > 0)
	{
		return 1;
	}
	else if(fltm_enum_ptcAdFlt > 0)
	{
		return  2;
	}
	else
	{
		return  0;
	}
}

/* ~{T$3d=S4%Fw9JUO~}  */
uint8_T Rte_CANTx_PreRlyFlt_GetVal(void)
{
	return 0;
}

/* ~{UfJ5~}SOC  */
uint16_T Rte_CANTx_SOC_GetVal(void)
{
	if(bottv_flg_SOCReady)
	{
//		if(soce_pct_SOC == 10000 && vewm_enum_SlowChgSts==2)
//		{
//			return soce_pct_SOC-100;
//		}
//		else
//		{
			return soce_pct_RealSOC;//soce_pct_SOC
//		}
	}
	else
	{
		return bottv_pct_initSoc;
	}
}

/* ~{5g3XNB2nRl3#1(>/~}  */
uint8_T Rte_CANTx_CellTempDiffFlt_GetVal(void)
{
	return fltm_enum_cellDiffTmpFlt;
}

/* ~{5g3XNB6H9}8_1(>/~}  */
uint8_T Rte_CANTx_CellTempOTFlt_GetVal(void)
{
	return fltm_enum_cellOTFlt||fltm_enum_cellOTChgFlt;
}

/* Pack~{9}Q91(>/~}  */
uint8_T Rte_CANTx_PackVoltOVFlt_GetVal(void)
{
	return fltm_enum_packOVFlt;
}

/* Pack~{G7Q91(>/~}  */
uint8_T Rte_CANTx_PackVoltUVFlt_GetVal(void)
{
	return fltm_enum_packUVFlt;
}

/* SOC~{9}5M1(>/~}  */
uint8_T Rte_CANTx_SOCUFlt_GetVal(void)
{
	return fltm_enum_socU;
}

/* ~{5%Le5gQ99}8_1(>/~}  */
uint8_T Rte_CANTx_CellOVFlt_GetVal(void)
{
	return fltm_enum_cellOVFlt;
}

/* ~{5%Le5gQ9G7Q91(>/~}  */
uint8_T Rte_CANTx_CellUVFlt_GetVal(void)
{
	return fltm_enum_cellUVFlt;
}

/* ~{5g3XR;VBPT2n1(>/~}  */
uint8_T Rte_CANTx_CellVoltDiffFlt_GetVal(void)
{
	return fltm_enum_cellDiffVolFlt;
}

/* ~{9}Aw9JUO~}  */
uint8_T Rte_CANTx_DsgOCFlt_GetVal(void)
{
	return fltm_enum_DsgOC;
}

/* SOC~{9}8_1(>/~}  */
uint8_T Rte_CANTx_SOCOFlt_GetVal(void)
{
	return (fltm_enum_socO > 0) ? 1:0;
}

/* SOC~{Lx1d1(>/~}  */
uint8_T Rte_CANTx_SOCJumpFlt_GetVal(void)
{
	return (fltm_enum_socJump > 0) ? 1:0;
}

/* ~{NB6H5M9JUO~}  */
uint8_T Rte_CANTx_CellTempUTFlt_GetVal(void)
{
	return fltm_enum_cellUTFlt;
}

/* ~{8_Q9;%Kx1(>/~}  */
uint8_T Rte_CANTx_HVILFlt_GetVal(void)
{
	return (fltm_enum_hvilFlt > 0)? 1:0;
}

/* ~{3d5g5gAwRl3#~}  */
uint8_T Rte_CANTx_ChgCurrAbnlFlt_GetVal(void)
{
	return 0;
}

/* ~{3d5g5gQ9Rl3#~}  */
uint8_T Rte_CANTx_ChgVoltAbnlFlt_GetVal(void)
{
	return 0;
}

/* 12V~{Pn5g3X5M9JUO~}  */
uint8_T Rte_CANTx_SplyPowerUVFlt_GetVal(void)
{
	return (fltm_enum_v12UL > 0)?1:0;
}

/* 12V~{Pn5g3X8_9JUO~}  */
uint8_T Rte_CANTx_SplyPowerFlt_GetVal(void)
{
	return (fltm_enum_v12Flt > 0)?1:0;
}

/* ~{5gP>5gQ92IQyO_5tO_~}  */
uint8_T Rte_CANTx_CellVoltSmpFlt_GetVal(void)
{
	return (fltm_enum_CellVolSmpFlt > 0) ? 1:0;
}

/* ~{5g3XNB6H4+8PFw9JUO~}  */
uint8_T Rte_CANTx_CellTempSmpFlt_GetVal(void)
{
	return (fltm_enum_CellTmpSmpFlt > 0) ? 1:0;
}

/* ~{5gAw4+8PFw9JUO~}  */
uint8_T Rte_CANTx_BatCurrSmpFlt_GetVal(void)
{
	return (fltm_enum_CurrSmpAbnl > 0) ? 1:0;
}

/* ~{M(Q69JUO~}  */
uint8_T Rte_CANTx_CANBusOffFlt_GetVal(void)
{
	return (fltm_enum_CANBusOff > 0) ? 1:0;
}

/* ~{Sk~}VCU~{M(Q6Rl3#~}  */
uint8_T Rte_CANTx_CANCommVCUFlt_GetVal(void)
{
	return (fltm_enum_vcuComFlt > 0) ? 1:0;
}

/* BMS~{Sk~}CM~{M(Q6Rl3#~}  */
uint8_T Rte_CANTx_CANCommOBDFlt_GetVal(void)
{
	return (fltm_enum_obcComFlt > 0) ? 1:0;
}

/* ~{<SHHJ'P'9JUO~}  */
uint8_T Rte_CANTx_HeatFlt_GetVal(void)
{
	return (fltm_enum_PTCHeatInvalid > 0) ? 1:0;
}

/* ~{=;Aw3d5g;z?XVF~}  */
//uint8_T Rte_CANTx_OBCCtr_GetVal(void)
//{
//	if(vewm_enum_SlowChgSts == 4)
//	{
//		return 1;
//	}
//	if(fltm_flg_ChgPwrDownFlt == 1)
//	{
//		return 2;
//	}
//	else
//	{
//		return 0;
//	}
//}

/* ~{=;Aw3d5g;z3d5gD#J=~}  */
uint8_T Rte_CANTx_OBCModeCtr_GetVal(void)
{
	static uint8_T cnt = 0;

	if(tmsc_enum_HeatSts == 2 || (tmsc_enum_HeatSts == 4 && vewm_flg_posRlyCtr == 0))
	{
		cnt = 0;
		return 1;
	}
	else
	{
		cnt ++;
	}
	if(cnt >= 4)
	{
		return 0;
	}
	else
	{
		return 1;
	}
}

/* ~{3d5gJ1<d~}  */
uint16_T Rte_CANTx_ChgTime_GetVal(void)
{
        static uint16_T  cnt=0;
        static uint16_T  chargetime = 0;
        if(tmsc_enum_HeatSts == 2)
        {
        	 return 120;
        }
        if(vewm_enum_workingMode == Pdcfg_WmSChging)
        {
        	cnt ++;
        	if(cnt >= 0)
        	{
        	        cnt = 0;
        	        Task_SOTE();
        	}

        	if(Rte_flg_SChgIgSts_GetVal()==0 || Rte_enum_SChgCcSts_GetVal()==0 || tmsc_flg_keepTemp || tmsc_enum_HeatSts==5 ||vewm_enum_SlowChgSts==4||(vewm_flg_posRlyCtr==0&&tmsc_enum_HeatSts!=3&&tmsc_enum_HeatSts!=2&&tmsc_enum_HeatSts!=4&&tmsc_enum_HeatSts!=1))
        	{
        	        return 0;
        	}
        	else
        	{
        	        return sote_min_SChgRamainingTime;
        	}
        }
        else if(vewm_enum_workingMode == Pdcfg_WmQChging)
        {
        	chargetime = (10000-soce_pct_DispSOC)*135/10*60/(1000000 - bottv_ma_cur);
        	return chargetime;
        }
        else
        {
        	return 0;
        }


}
///* ~{3d5gJ1<d~}  */
//uint16_T Rte_CANTx_ChgTime_GetVal(void)
//{
//        static uint16_T  cnt=0;
//
//        cnt ++;
//        if(cnt >= 0)
//        {
//                cnt = 0;
//                Task_SOTE();
//        }
//
//        if(tmsc_flg_keepTemp || tmsc_enum_HeatSts==5 ||vewm_enum_SlowChgSts==4||(vewm_flg_posRlyCtr==0&&tmsc_enum_HeatSts!=2&&tmsc_enum_HeatSts!=4))
//        {
//                return 0;
//        }
//        else
//        {
//                return sote_min_SChgRamainingTime;
//        }
//
//}
//uint16_T Rte_CANTx_ChgTime_GetVal(void)
//{
//	static uint16_T  cnt=0;
//
//	cnt ++;
//	if(cnt >= 0)
//	{
//		cnt = 0;
//		Task_SOTE();
//	}
//
//	return sote_min_SChgRamainingTime;
//}

/* Pack~{5%Le5gP>W\J}~}  */
uint8_T Rte_CANTx_CellVoltTotalNum_GetVal(void)
{
	return Pdcfg_CellVoltUseNum;//BMS_CELL_TOTAL_CNT;
}

/* Pack~{5gP>NB6H5cW\J}~}  */
uint8_T Rte_CANTx_CellTempTotalNum_GetVal(void)
{
	return Pdcfg_CellTempUseNum;//BMS_CELLTEM_TOTAL_CNT;
}

/* ~{?I3d5g4"D\O5M3J}D?~}  */
uint8_T Rte_CANTx_BattSysNum_GetVal(void)
{
	return 1;
}

/* ~{?I3d5g4"D\O5M3Pr:E~}  */
uint8_T Rte_CANTx_BattSysSerialNum_GetVal(void)
{
	return 1;
}

/* PACK~{TJPmWnP!7E5g5gQ9~}  */
uint16_T Rte_CANTx_PackMinVoltPrmt_GetVal(void)
{
	return (uint16_T)((uint32_T)Pccfg_CellVoltMinPrmt*Pdcfg_CellVoltUseNum/1000)*2;
}

/* PACK~{TJPmWn4s7E5g5gQ9~}  */
uint16_T Rte_CANTx_PackMaxVoltPrmt_GetVal(void)
{
	return (uint16_T)((uint32_T)Pccfg_CelVoltMaxPrmt*Pdcfg_CellVoltUseNum/1000)*2;
}


/* ~{5g3X5%Le5gQ9~}  */
uint16_T Rte_CANTx_CellVolt_GetVal(uint8_T cellnum)
{
	return bottv_mv_cellVolt[cellnum-1];
}

/* ~{5g3X5%Le5gQ9~}  */
uint8_T Rte_CANTx_CellTemp_GetVal(uint8_T cellnum)
{
	return bottv_c_cellTemp[cellnum];
}

/*
 * Bit 1-0:11:~{5gA?5MJ1AA~}  10:~{3d5gJGIA6/~} 00:~{3#Cp~}(~{N43d5g~})
 * Bit 2  :1:~{2eG9AA~}  ~{!!!!~}0:~{3#Cp~}
 * Bit 3  :1:~{>xT55gWh5M~} 0:~{3#Cp~}
 * Bit 4  :1:~{5gQ95M!!!!~} 0:~{3#Cp~}
 * Bit 5  :1:SOC~{5MV8J>~} 0:~{3#Cp~}
 * Bit 6  :1:~{5g3X9JUO~} 0:~{N^9JUO~}
 * Bit 7  :1:Beep~{Ol~} 0:Beep~{M#~}
 */
uint8_T Rte_CANTx_LEDs_GetVal(void)
{
	uint8_T LedSts[7] = {0,0,0,0,0,0,0};


	if(fltm_enum_socU > 0 &&(vewm_enum_SlowChgSts != 2) && (vewm_enum_SlowChgSts !=3))

	{
		LedSts[0] = 3;
	}
	else if(vewm_enum_SlowChgSts == 3 || vewm_enum_SlowChgSts == 2)
	{
		LedSts[0] = 2;
	}
	else
	{
		LedSts[0] = 0;
	}

	if(vewm_enum_SlowChgSts != 3 && vewm_enum_SlowChgSts != 2)
	{
		LedSts[3] = (fltm_enum_cellUVFlt>0 || fltm_enum_packUVFlt>0)?1:0;
		LedSts[4] = (fltm_enum_socU>0)?1:0;
	}
	LedSts[1] = (bottv_flg_slowCHGCC==1)? 1:0;
	LedSts[2] = ((fltm_enum_insuU)>0)?1:0;
	LedSts[5] = (fltm_num_maxFltNo>0)?1:0;
	LedSts[6] = 0;


	return (uint8_T)(LedSts[6]<<7 | LedSts[5]<<6 | LedSts[4]<<5 | LedSts[3]<<4 |LedSts[2]<<3 |LedSts[1]<<2 |LedSts[0]);
}

//uint16_T Rte_CANTx_ResCap_GetVal(void)
//{
//	return (uint16_T)((uint32_T)(nmcpv_mas_ah)*sohe_pct_soh/1000*Rte_CANTx_SOC_GetVal()/10000);
//}

//0 ~{3uJ<;/~}  1
uint16_T Rte_CANTx_BatSts_GetVal(void)
{
	static uint8_T sts=0;

//	if(Rte_CANTx_BatMode_GetVal()==0 || Rte_CANTx_BatMode_GetVal()==1)
//	{
//		sts = 0;
//	}
//	else if(Rte_CANTx_BatMode_GetVal() == 2 || Rte_CANTx_BatMode_GetVal()==5)
//	{
//		sts = 0;
//	}
	if(vewm_flg_prechgRlyCtr == 1)
	{
		sts = 1;
	}
//	else if(tmsc_flg_PTCRlyCtr==1 && vewm_enum_workingMode == Pdcfg_WmSChging)
//	{
//		sts = 6;
//	}
//	else if(tmsc_flg_PTCRlyCtr==1 && vewm_enum_workingMode == Pdcfg_WmQChging)
//	{
//		sts = 5;
//	}
	else if(vewm_flg_posRlyCtr == 1 || tmsc_flg_PTCRlyCtr==1)//~{3B~}
	{
		sts = 2;
	}
//	else if(Rte_CANTx_BatMode_GetVal() == 5)
//	{
//		sts = 4;
//	}
	else
	{
		sts = 0;
	}
	return sts;
}

/*
 * 0=Boot Up
 * 1=~{WTUo6O~}
 * 2=~{5H4}IO8_Q9~}
 * 3=~{7E5g~}
 * 4=~{T$At~}
 * 5=~{<lP^D#J=~}
 * 6=DC ~{3d5gD#J=~}
 * 7=AC ~{3d5gD#J=~}
 * 8=DC ~{2eG9N43d5g~}
 * 9=AC ~{2eG9N43d5g~}
 */

uint16_T Rte_CANTx_BatMode_GetVal(void)
{
	static uint8_T sts=0;

	if(fltm_enum_SelfChkSts == 0)
	{
		sts = 1;
	}
	else if(vewm_enum_DisSts == 0 && vewm_enum_SlowChgSts !=2 && vewm_enum_SlowChgSts !=3 && vewm_enum_FastChgSts !=2 && vewm_enum_FastChgSts !=3)
	{
		sts = 2;
	}
	else if(vewm_enum_DisSts == 2)
	{
		sts = 3;
	}
	else if(vewm_enum_SlowChgSts == 2)
	{
		sts = 7;
	}
	else if(vewm_enum_SlowChgSts !=2 && vewm_enum_SlowChgSts !=3 && bottv_flg_slowCHGCC == 1)
	{
		sts = 9;
	}
	else if((vewm_enum_DisSts == 3 || vewm_enum_SlowChgSts == 3) && vewm_flg_posRlyCtr == 0)
	{
		sts = 5;
	}
	else
	{}

	return sts;

}


uint8_T Rte_CANTx_VCUCommSts(void)
{
	static uint8_T old_Life = 0;
	static uint8_T tmp = 0 ;
	static uint8_T cnt = 0;

	if(Rte_CANRx_VCU_LifeCnt != old_Life)
	{
		tmp = 1;
		cnt = 0;
	}
	else
	{
		cnt ++;
	}

	if(cnt >= 50)
	{
		cnt = 50;
		tmp = 0;
	}


	old_Life = Rte_CANRx_VCU_LifeCnt;

	return tmp;
}


uint8_T Rte_CANTx_OBCCommSts(void)
{
	static uint8_T old_Life = 0;
	static uint8_T tmp = 0 ;
	static uint8_T cnt = 0;

	if(Rte_CANRx_OBC_LifeCnt != old_Life)
	{
		tmp = 1;
		cnt = 0;
	}
	else
	{
		cnt ++;
	}

	if(cnt >= 50)
	{
		cnt = 50;
		tmp = 0;
	}


	old_Life = Rte_CANRx_OBC_LifeCnt;

	return tmp;
}

uint32_T Rte_CANRx_TatolAllChg_GetVal(void)
{
	return nvm_kw_TatolAllChg/10;
}

uint32_T Rte_CANRx_TatolDsg_GetVal(void)
{
	return nvm_kw_TatolDsg/10;
}

uint16_T Rte_CANRx_sigChgEny_GetVal(void)
{
	return nvm_ah_sigDsgCap*112/1000;
}


uint8_T Rte_CANRx_Obc_ChgSts_GetVal(void)
{
	return Rte_CANRx_Obc_ChgSts;
}

uint8_T Rte_CANRx_tDuty_GetVal(void)
{

	return Rte_CANRx_tDuty;
}

uint8_T Rte_CANRx_QchgAlow_GetVal(void)
{
	return Rte_CANRx_QchgAlow;
}



uint8_T Rte_CANRx_DcChgReq_GetVal(void)
{
	if(vewm_enum_FastChgSts == 4 || fltm_flg_ChgPwrDownFlt == 1)
	{
		return 2;
	}
	else
	{
		return 1;
	}
}

uint8_T Rte_CANRx_FDCMaiPosRlySts_GetVal(void)
{
	return Rte_CANRx_FDCMaiPosRlySts;
}
